Skip to main content
13 events
when toggle format what by license comment
Oct 26, 2016 at 20:48 comment added chux @Edward OK. The .x1 field contains the addend. More details added.
Oct 26, 2016 at 20:47 history edited chux CC BY-SA 3.0
added 435 characters in body
Oct 26, 2016 at 20:27 comment added Edward What's not clear is that in the formulation of the question, a, b and c are individual addends but in your code they appear to be accumulators. Also it's not clear what factor is or why one would adjust it.
Oct 26, 2016 at 15:32 history edited chux CC BY-SA 3.0
added 65 characters in body
Oct 26, 2016 at 15:31 comment added Tavian Barnes @chux Ah okay, I took that as a description of the current code, rather than a direction for the reader.
Oct 26, 2016 at 15:30 comment added chux @TavianBarnes The // Adjust to 128 bit type typedef uintmax_t uint_fast128t; is simply a place-holder for whatever 128-bit type a compiler may have access - adjust as needed. __uint128_t is not part of standard C, yet an efficient solution would use some extension such as __uint128_t . IAC, larger than 64-bit math is not needed until factor < 7.
Oct 26, 2016 at 15:26 comment added Tavian Barnes uintmax_t is not 128 bits on any platform I know of, certainly not x86_64 Linux with gcc. You'll need to use __uint128_t.
Oct 26, 2016 at 15:20 comment added chux @Edward What parts of code were not clear?
Oct 26, 2016 at 3:17 comment added Edward It's not entirely clear what the code is actually doing mathematically. Could you explain it?
Oct 26, 2016 at 2:49 history edited chux CC BY-SA 3.0
deleted 12 characters in body
Oct 26, 2016 at 2:28 history edited chux CC BY-SA 3.0
added 1957 characters in body
Oct 26, 2016 at 2:03 history edited chux CC BY-SA 3.0
added 1957 characters in body
Oct 25, 2016 at 23:04 history answered chux CC BY-SA 3.0