Please provide the following information:
ROOT Version 6.12/06
Platform: MacOS 10.13.14:
compiler:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
Why the output of TMath::ACos(x), with x<-1. and x>1, is not a NaN?
root [0] TMath::ACos(-3)
(double) 3.1415927
root [1] TMath::ACos(3)
(double) 0.0000000
root [2]
What am I overlooking?
Thanks a lot,
Tommaso and Carmelo
couet
May 16, 2018, 8:10am
2
Because it is explicitly implemented that way . I do not know why … I let @moneta comment about it.
Note you can use std::acos
directly:
root [0] std::acos(3)
(double) nan
I think this is historic. There was a protection to avoid Nan added a long time ago. It could be probably be removed now, on the other hand there is no real reason to use TMath::ACos, so if the user prefers having a NaN returned he could use directly std::acos
Lorenzo
system
Closed
May 30, 2018, 8:34am
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.