Thread overview | |||||
---|---|---|---|---|---|
|
April 28, 2013 How to deal with systems where real == double | ||||
---|---|---|---|---|
| ||||
How do we want to deal with systems which have no floating point type bigger than double? * What's the proper check to detect this in druntime / phobos? (real.sizeof == double.sizeof) or (real.mant_dig == double.mant_dig)? * Should the long double functions (tanl, cosl) be available from druntime? If so we need to alias them. Glibc does not provide the long double functions on a target without long double. * What about phobos functions overloads using "real"? Should those be disabled completely or should they call the "double" equivalent function? |
April 28, 2013 Re: How to deal with systems where real == double | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau | On Sunday, 28 April 2013 at 08:39:47 UTC, Johannes Pfau wrote: > How do we want to deal with systems which have no floating point type > bigger than double? > > * What's the proper check to detect this in druntime / phobos? > (real.sizeof == double.sizeof) or (real.mant_dig == double.mant_dig)? First should be sufficient, but I suppose both if you want to account for some hypothetical machine where the sizes are the same, but have a different number of mantissa bits. > * Should the long double functions (tanl, cosl) be available from > druntime? If so we need to alias them. Glibc does not provide the > long double functions on a target without long double. I think they should be available and just use the double versions. I don't see much point in needlessly breaking code that uses reals when they're the same as doubles. > * What about phobos functions overloads using "real"? Should those be > disabled completely or should they call the "double" equivalent > function? They should be aliases to the double versions or just call them. Not sure which, but we definitely should not just disable those overloads otherwise we just break code that uses reals unnecessarily. |
April 29, 2013 Re: How to deal with systems where real == double | ||||
---|---|---|---|---|
| ||||
Posted in reply to Peter Alexander | real is defined to be the largest floating point type supported on the target machine, so if that's the same as double, then it's double (though still a distinct type to the D typing system). |
Copyright © 1999-2021 by the D Language Foundation