It is currently April 24th, 2024, 10:28 pm

Number measure extension "0"

Get help with creating, editing & fixing problems with skins
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Number measure extension "0"

Post by Yamajac »

balala wrote: November 14th, 2019, 9:15 pm Don't worry, it happens to all of us sometimes to miss such details.

Well, unfortunately there still is a problem: if the number generated by the Rand function of the [RandomNumber] measure is so large that the number returned by the measure has more digits than MinValue, the result is wrong again. Check it increasing the HighBound value of the
[RandomNumber] measure.
Unfortunately the code should handle such cases as well.
I'm not sure what you mean. Can you show me a video of this happening? This won't cull digits by design. If you want it to it's not hard to make that happen.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Number measure extension "0"

Post by balala »

Yamajac wrote: November 14th, 2019, 9:37 pm I'm not sure what you mean. Can you show me a video of this happening? This won't cull digits by design. If you want it to it's not hard to make that happen.
There is no need for a video. Just replace the HighBound option of the [MeasureRand] measure with: HighBound=21474836454343.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Number measure extension "0"

Post by Yamajac »

balala wrote: November 14th, 2019, 9:50 pm There is no need for a video. Just replace the HighBound option of the [MeasureRand] measure with: HighBound=21474836454343.
This isn't a bug with the regex, it's just that the calc can't handle numbers that large. You can see that the RandomNumber measure isn't showing a large number.

The HighBound I used there was the largest number the random function can use. If you add even 1 it breaks the calc measure, but the regex still works just fine. You can test this by replacing Random/1000 with the same number and it will work fine.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Number measure extension "0"

Post by balala »

Yamajac wrote: November 14th, 2019, 10:14 pm The HighBound I used there was the largest number the random function can use. If you add even 1 it breaks the calc measure,
Yes, right. Now I see. The largest value of HighBound is 2,147,483,647, according to this: https://docs.rainmeter.net/manual/measures/calc/#HighBound
Sorry...