Home » Developing U++ » U++ Developers corner » Value with type float
Re: Value with type float [message #60200 is a reply to message #60198] |
Fri, 06 October 2023 12:51   |
 |
mirek
Messages: 14256 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Wed, 04 October 2023 12:08mirek wrote on Wed, 04 October 2023 10:55Just revisting this issue...
Tom1 wrote on Fri, 03 June 2022 12:03
- I can use Value with float as easily as with double without explicit type casts anywhere
Yes.
Quote:
- Assigning a float to Value reads back from Value exactly the same as it went in
If "reads back" means text output, then yes.
Quote:
- If EditFloat* is again replaced by EditDouble*, the behavior is exactly the same as it is now with EditFloat*
Should work.
Quote:
- float supports Null
No. Is that a problem?
Quote:
Maybe the precision hint you are suggesting could be automatically initialized in Value(double) / Value(float) constructors and assignment operators =(double) / =(float) to suit the assigned data type?
That was exactly the plan.
I think advantage of this solution is that it allows you to specify arbitrary precision for any double-holding Value. E.g.
double x = 3.14159;
Value json;
json("pi") = Precision(x, 2); // Precision does not exist yet
DDUMP(AsJSON(json));
Still an idea though.
Hi Mirek,
Thanks for the update on this subject.
For me 'reads back exactly the same' means binary equality:
float a = 1.234562f;
float b = 1.234562f;
Value c = b;
b = c;
if(a == b) Cout() << "Great, it works!\r\n"
else Cout() << "No, it does not read back the same...\r\n";
This works (and I believe it should) right now. Am I missing something?
Quote:
As for float Null, yes, please include the changes shown in:
https://www.ultimatepp.org/forums/index.php?t=msg&th=120 82&goto=59874&#msg_59874
I am reluctant adding yet another Null...
Mirek
|
|
|
 |
|
Value with type float
|
 |
|
Re: Value with type float
By: mirek on Sat, 19 March 2022 10:38
|
 |
|
Re: Value with type float
|
 |
|
Re: Value with type float
By: Tom1 on Thu, 31 March 2022 13:49
|
 |
|
Re: Value with type float
By: Tom1 on Thu, 31 March 2022 15:14
|
 |
|
Re: Value with type float
By: mirek on Fri, 01 April 2022 11:07
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 01 April 2022 11:13
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 01 April 2022 12:06
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 01 April 2022 14:03
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 01 April 2022 15:26
|
 |
|
Re: Value with type float
By: mirek on Sat, 02 April 2022 01:31
|
 |
|
Re: Value with type float
By: mirek on Sat, 02 April 2022 01:31
|
 |
|
Re: Value with type float
By: mirek on Sat, 02 April 2022 09:43
|
 |
|
Re: Value with type float
By: Tom1 on Sat, 02 April 2022 10:55
|
 |
|
Re: Value with type float
By: mirek on Sat, 02 April 2022 11:26
|
 |
|
Re: Value with type float
By: Tom1 on Sat, 02 April 2022 13:31
|
 |
|
Re: Value with type float
By: mirek on Mon, 11 April 2022 16:52
|
 |
|
Re: Value with type float
By: Tom1 on Tue, 12 April 2022 09:26
|
 |
|
Re: Value with type float
By: mirek on Tue, 12 April 2022 13:40
|
 |
|
Re: Value with type float
By: Tom1 on Tue, 12 April 2022 13:54
|
 |
|
Re: Value with type float
By: Tom1 on Tue, 10 May 2022 13:21
|
 |
|
Re: Value with type float
By: mirek on Tue, 10 May 2022 15:44
|
 |
|
Re: Value with type float
By: Tom1 on Tue, 10 May 2022 20:08
|
 |
|
Re: Value with type float
By: mirek on Tue, 10 May 2022 21:26
|
 |
|
Re: Value with type float
By: Tom1 on Wed, 11 May 2022 08:20
|
 |
|
Re: Value with type float
By: mirek on Fri, 03 June 2022 10:52
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 03 June 2022 12:03
|
 |
|
Re: Value with type float
By: mirek on Wed, 04 October 2023 09:55
|
 |
|
Re: Value with type float
By: Tom1 on Wed, 04 October 2023 12:08
|
 |
|
Re: Value with type float
By: mirek on Fri, 06 October 2023 12:51
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 06 October 2023 13:40
|
 |
|
Re: Value with type float
By: mirek on Fri, 06 October 2023 13:54
|
 |
|
Re: Value with type float
By: Tom1 on Fri, 06 October 2023 14:28
|
 |
|
Re: Value with type float
By: mirek on Mon, 30 October 2023 10:34
|
 |
|
Re: Value with type float
By: Tom1 on Mon, 30 October 2023 12:27
|
 |
|
Re: Value with type float
By: mirek on Mon, 30 October 2023 13:37
|
 |
|
Re: Value with type float
By: mirek on Fri, 01 April 2022 11:03
|
 |
|
Re: Value with type float
By: jimlef on Tue, 06 September 2022 01:41
|
 |
|
Re: Value with type float
By: Oblivion on Tue, 06 September 2022 22:42
|
 |
|
Re: Value with type float
By: jimlef on Thu, 08 September 2022 14:49
|
Goto Forum:
Current Time: Thu May 01 01:18:04 CEST 2025
Total time taken to generate the page: 0.00839 seconds
|