'real' not able to store it's largest value
colin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon May 22 13:26:27 PDT 2017
Am I doing something wrong here?
real.max evaluates to: 1.18973e+4932
So, I'd expect to be able to store any value up to that... however
```
void main()
{
writeln("Real max: ", real.max);
foreach(i; 0..10){
writefln!("1024 ^^ %s = %s")(i, real(1024 ^^ i));
}
}
```
Output:
```
Real max: 1.18973e+4932
1024 ^^ 0 = 1
1024 ^^ 1 = 1024
1024 ^^ 2 = 1.04858e+06
1024 ^^ 3 = 1.07374e+09
1024 ^^ 4 = 0
1024 ^^ 5 = 0
1024 ^^ 6 = 0
1024 ^^ 7 = 0
1024 ^^ 8 = 0
1024 ^^ 9 = 0
```
More information about the Digitalmars-d-learn
mailing list