Closed bewantbe closed 4 years ago
Yup, it is a shame it hasn't been fixed yet.
This issue cause ns-3 int64x64 TEST Failed. https://groups.google.com/g/ns-3-users/c/xfyQMrVisrc
WSL2 fails on one of my laptops, so I use WSL1.
On another (newer) laptop, WSL2 "works" but I need to use VirtualBox, and I have had no end of difficulty trying to get the two to work together, so WSL2 is not an option on that computer either.
So, some of us need WSL1. Please fix it!
@jlearman they didn't fix this in 8 years because the NT folks refuse to do it... Unless a big company or government asks for it, I doubt they will ever bother. If I may suggest, vagrant and multipass work with VirtualBox.
This program
outputs (Linux, expected result):
1.00000000000000000e-05
But in BashOnWindows, it outputs:
1.00000000000000008e-05
The long double data type in C/C++ under Linux using GCC for x86/x86-64 platform has an 80-bit format with 64 bits mantissa. When a program using long double runs in BashOnWindows it behaves like having 53 bits mantissa number just like the usual "double" (but with almost the same exponential range as long double)
This harms functions like std::pow(long double, int) and hence
boost::lexical_cast<double>(char*)
(boost version 1.55) since internally it uses long double as intermediate result (but boost version 1.60 fixes this problem), thereforeboost::program_options
can reads double type options inaccurately also (even for exact input e.g. 0.03125 = 1/32).Likewise this program:
Should output:
Good.
While in BashOnWindows, it output:What? t0 = 7.46536864129530799e-4948 != 3.64519953188247460e-4951