[4.10]Maps store floats instead of doubles

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [4.10]Maps store floats instead of doubles

Re: [4.10]Maps store floats instead of doubles

by Major Cooke » Sun Dec 04, 2022 2:00 pm

Ah okay, glad to hear, was worried about that. I don't know how to read that code very well.

Re: [4.10]Maps store floats instead of doubles

by Graf Zahl » Sun Dec 04, 2022 2:00 pm

Still needs the warnings fixed, though, but that's of lesser concern.

Re: [4.10]Maps store floats instead of doubles

by Graf Zahl » Sun Dec 04, 2022 1:58 pm

Yes, I noticed while checking this out. Seems someone did not look deeply enough. Thank god it's a false alert.

Re: [4.10]Maps store floats instead of doubles

by Jay0 » Sun Dec 04, 2022 1:57 pm

That's not the case, there's a Map<X,float> for type 32-bit float types, and Map<X, double> for 64-bit float types (you can see that this is for the 32-bit type because the type is XXXX_F32 and not XXXX_F64)

Re: [4.10]Maps store floats instead of doubles

by Graf Zahl » Sun Dec 04, 2022 1:55 pm

There's also a map type using doubles.

[4.10]Maps store floats instead of doubles

by Major Cooke » Sun Dec 04, 2022 1:52 pm

Code: Select all

2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(165,23): warning C4244: 'argument': conversion from 'double' to 'VT', possible loss of data
2>        with
2>        [
2>            VT=float
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(470): message : see reference to function template instantiation 'void MapInsert<FMap_I32_F32>(M *,unsigned int,double)' being compiled
2>        with
2>        [
2>            M=FMap_I32_F32
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(249,11): warning C4244: '=': conversion from 'double' to 'VT', possible loss of data
2>        with
2>        [
2>            VT=float
2>        ]
2>C:\Games\doom 2\GZSource\src\common\scripting\core\maps.cpp(470): message : see reference to function template instantiation 'void MapIteratorSetValue<FMapIterator_I32_F32>(I *,double)' being compiled
2>        with
2>        [
2>            I=FMapIterator_I32_F32
2>        ]
I'm concerned that if it's used to store doubles, the result will not be precise if that's what's needed.

Top