digitalmars.D - float.min, double.min, int.min
- Andrea Fontana (16/16) Nov 28 2011 dmd 2.056.
- so (4/20) Nov 28 2011 D doing exactly same thing what it's predecessor doing.
- Andrea Fontana (3/29) Nov 28 2011 =20
- bearophile (4/16) Nov 28 2011 FP.min is deprecated in D, it just causes confusion. Please Kenji Hara m...
dmd 2.056. void main(string[] args) { writeln("int.max: ", int.max); writeln("int.min: ", int.min); writeln("float.max: ", float.max); writeln("float.min: ", float.min); } it prints: int.max: 2147483647 <-- no int > int.max int.min: -2147483648 <-- no int < int.min float.max: 3.40282e+38 <-- no float > float.max float.min: 1.17549e-38 <-- this shoud be -float.max (or -inf?). It's not a min... =20 assert(-1 < float.min); // passed!=20 This drives me crazy on neural network...
Nov 28 2011
On Mon, 28 Nov 2011 16:53:11 +0200, Andrea Fontana <advmail katamail.com> wrote:dmd 2.056. void main(string[] args) { writeln("int.max: ", int.max); writeln("int.min: ", int.min); writeln("float.max: ", float.max); writeln("float.min: ", float.min); } it prints: int.max: 2147483647 <-- no int > int.max int.min: -2147483648 <-- no int < int.min float.max: 3.40282e+38 <-- no float > float.max float.min: 1.17549e-38 <-- this shoud be -float.max (or -inf?). It's not a min... assert(-1 < float.min); // passed! This drives me crazy on neural network...D doing exactly same thing what it's predecessor doing. For example, everyone mostly define their own FLOAT_MIN, in C/C++.
Nov 28 2011
D fixed a lot of predecessor's mistakes :) Il giorno lun, 28/11/2011 alle 16.59 +0200, so ha scritto:On Mon, 28 Nov 2011 16:53:11 +0200, Andrea Fontana <advmail katamail.com>==20wrote: =20dmd 2.056. void main(string[] args) { writeln("int.max: ", int.max); writeln("int.min: ", int.min); writeln("float.max: ", float.max); writeln("float.min: ", float.min); } it prints: int.max: 2147483647 <-- no int > int.max int.min: -2147483648 <-- no int < int.min float.max: 3.40282e+38 <-- no float > float.max float.min: 1.17549e-38 <-- this shoud be -float.max (or -inf?). It's not a min... assert(-1 < float.min); // passed! This drives me crazy on neural network...=20 D doing exactly same thing what it's predecessor doing. For example, everyone mostly define their own FLOAT_MIN, in C/C++.
Nov 28 2011
Andrea Fontana:writeln("int.max: ", int.max); writeln("int.min: ", int.min); writeln("float.max: ", float.max); writeln("float.min: ", float.min); } it prints: int.max: 2147483647 <-- no int > int.max int.min: -2147483648 <-- no int < int.min float.max: 3.40282e+38 <-- no float > float.max float.min: 1.17549e-38 <-- this shoud be -float.max (or -inf?). It's not a min...FP.min is deprecated in D, it just causes confusion. Please Kenji Hara make it available with -d only soon :-) Bye, bearophile
Nov 28 2011