Re:Computing the number of digits of an integer even faster
by knuthsat on Friday June 04, 2021 @12:47PM
(#27395572)
One other way to prove these algorithms is by writing them in z3 prover. You write a simple one that is 100% correct and then you prove equality for your optimized one or find an example that will show inequality.
[ Parent
| on HN ]
Re:Computing the number of digits of an integer even faster
by chrisseaton on Friday June 04, 2021 @12:59PM
(#27395747)
A great thing about a monadic operation that takes a 32-bit integer, like this one, is that you can also just exhaustively test it in reasonable time!
Re:Computing the number of digits of an integer even faster
by Dylan16807 on Friday June 04, 2021 @03:37PM
(#27398129)
Today I learned "monadic" has two significantly different meanings in the realm of programming.
I'm only familiar with using "unary" to mean single-parameter.
Re:Computing the number of digits of an integer even faster
by Filligree on Friday June 04, 2021 @05:13PM
(#27399140)
Nah, they’re pretty much the same meaning.
Re:Computing the number of digits of an integer even faster
by Dylan16807 on Friday June 04, 2021 @05:33PM
(#27399309)
A monad, derived from monoid, means multiple very specific things completely unrelated to the other definition of "single parameter".
And the etymology is basically a coincidence because "mono" got used in different places, isn't it?
Re:Computing the number of digits of an integer even faster
by a1369209993 on Friday June 04, 2021 @07:14PM
(#27400178)
> []completely unrelated[] to the other definition of "single parameter".
Actually, all monads are monadic functions/operators on their (usually type) parameter. Eg, 'list' is a monadic operator from element types to types of lists of those elements.
It's completely different (AFAICT), and mostly unrelated, but it's not completely unrelated.