Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1644

Other Uncategorized Skins • Re: HowOldIs2025 (UTC)

$
0
0
Just out of curiosity, is this correct in your code?

Formula=( 100 * MeasureAge / #SecondsInAYear# )

My understanding is that multiplication and division are not done in a defined order, but are based on the order in the formula.

So wouldn't this result in 100 * MeasureAge, with that result divided by #SecondsInAYear# ?



Your result appears correct, so I guess not...
Yes, it is correct. Multiplication and division are operations of the same level (this is said in the quote you've posted as well), being performed in the order they appear in the formula. This means that in my formula first is done the multiplication of 100 by [MeasureAge], then the result is divided by #SecondsInAYear# (as you said). You get the same result if you divide first the [MeasureAge] by #SecondsInAYear#, then you multiply the result by 100 (the first example below). In both cases, you get a number between 0 (at Jan 1st 0:00 AM) and (almost) 100 (on Dec 31st 11:59:59PM). But you could write those elements in different order as well. For instance the followings are giving the same result: Formula=(( MeasureAge / #SecondsInAYear# ) * 100 ), Formula=( 100 * ( MeasureAge / #SecondsInAYear# )), Formula=( MeasureAge * 100 / #SecondsInAYear# ) or Formula=(( 100 * MeasureAge) / #SecondsInAYear# ).

Statistics: Posted by balala — Today, 4:42 pm



Viewing all articles
Browse latest Browse all 1644

Trending Articles