User talk:Vincent Lefèvre

From Wikipedia, the free encyclopedia
Jump to: navigation, search

IEEE 754 preferred width and double rounding[edit]

Someone was adding a bit to IEEE 754-2008 about expression evaluation and a bit of the standard there struck me as worth querying.

My reading of the preferred width recommendations in IEEE 754-2008 is that if you have a statement


where x, y, z are all double but the block has preferred width extended then y and z should be added using extended precision and then assigned to x, so one would have double rounding. Is that correct do you think? Thanks Dmcq (talk) 23:33, 6 April 2012 (UTC)

Yes, in this case, one has double rounding. In order to avoid double rounding, one can use the format-Of operations (Section 5.4) instead of the ones affected by preferredWidth. Note that IEEE 754-2008 doesn't define bindings, so that when one writes x=y+z in a language, it is up to the language to specify which kind of operation is used (depending on the context). Vincent Lefèvre (talk) 00:27, 7 April 2012 (UTC)
Thanks very much. Well setting preferred width to none should do that I believe so that's okay. I guess whatever one does something one doesn't think of will happen! Dmcq (talk) 15:09, 7 April 2012 (UTC)

A barnstar for you![edit]

Vitruvian Barnstar Hires.png The Technical Barnstar
I am awarding you this Technical Barnstar for your work on IEEE floating point. Good Job! Guy Macon (talk) 03:21, 13 November 2012 (UTC)

Double-quad, quad-single, etc.[edit]

Could you take a look at Quadruple-precision floating-point format#Double-double arithmetic an perhaps expand it a bit? In particular, many embedded processors have 32-bit floating point arithmetic, and there is a lot of interest in combining two, three or four 32-bit numbers to get extended precision. Yet double-single and quad-single don't seem to be covered anywhere on Wikipedia. Thanks! --Guy Macon (talk) 08:51, 15 November 2012 (UTC)

"Rounding" article undo (incorrect formulas)[edit]

Why the formulas are incorrect? If you mean rounding half-integer always up (like MS Excel function EVEN() do), or always down - it is not bankers' rounding.

If the fraction of number is 0.5 (half-integer), then rounded number is the even integer nearest (maybe up, maybe down) to initial number.

0.5 rounded to 0; 1.5 to 2; 2.5 to 2; 3.5 to 4; 4.5 to 4 and so on.

-0.5 rounded to 0; -1.5 to -2; -2.5 to -2; -3.5 to -4; -4.5 to -4 and so on.

On the other hand each even number has two entries of half-integers: 0 has 0.5 and -0.5; 2 has 1.5 and 2.5; -2 has -1.5 and -2.5 an so on.

That is the point of banker's rounding - unbiased rounding.

It is almost the same arguments for rounding half to odd formula.

If you are confused with multiplier (factor) before floor brackets, or addend inside floor brackets, you should understand that the floor or ceiling brackets are not usual brackets (parentheses) - you can't carry out or in anything, except integer addend (subtrahend), as usual as you do with simple brackets. Floor and ceiling functions have some unique rules. Anyway, just try my formulas with few half-integer numbers and say where I have mistaken. :-)

P.S. Sorry for my English.

Borman05 (talk) 16:49, 11 April 2014 (UTC)

The incorrectness is for non-half-integers. For Round half to even on y = 1, q=2\lfloor\frac{y}{2}+0.5\rfloor gives 2 instead of 1. For Round half to odd on y = 0, q=2\lfloor\frac{y}{2}\rfloor+1 gives 1 instead of 0.
Vincent Lefèvre (talk) 17:00, 11 April 2014 (UTC)
I understand this, but this is not common formulas for all cases. As it was said earlier in article: "Rounding a number y to the nearest integer requires some tie-breaking rule for those cases when y is exactly half-way between two integers — that is, when the fraction part of y is exactly 0.5"
These simple formulas only for half-integers
Borman05 (talk) 17:32, 11 April 2014 (UTC)
No, there is a tie-breaking rule for special cases, but then, from this tie-breaking rule, one can find formulas that are valid for all numbers (those given for Round half up to Round half towards zero). Note that if you wanted formulas for half-integers only, such formulas could be simpler than those given.
Vincent Lefèvre (talk) 21:44, 11 April 2014 (UTC)

PWD meaning.[edit]

Read the PWD talk page[edit]

You have removed my edit in that page qithout understanding what was posted. Please make sure to READ the relevant talk page for a deeper clarification. Only after you have debunked the claims in that page (if indeed they are wrong) is that you may remove my post. Talk:Pwd#PWD meaning. — Preceding unsigned comment added by JustToHelp (talkcontribs) 05:38, 22 December 2014‎ (UTC)

Vincent Lefèvre doesn't need your permission to remove your edits, so you might as well stop giving orders as if you are in charge. The Wikipedia pages that best explain what behavior is and is not allowed when two editors disagree about the content of a page are WP:BRD and WP:CONSENSUS. --Guy Macon (talk) 01:42, 13 August 2015 (UTC)

C Data Types[edit]

Genepy Quantum (talk) 01:57, 11 November 2015 (UTC)

Why are you reverting my correct changes? You can calculate the range of data types in this way: short int: 2 bytes i.e. 16 bits. 216 = 65536 possibilities. Now let's consider number including zero: we have 65536 numbers from 0 to 65535 (including 0 and 65535). If you split this range with the sign behaviour of the type you have: 32768 numbers from -32768 to -1 and 32768 numbers from 0 to 32767. So for a 2 bytes signed data type the range is [-32768 ; 32767]. for a 4 bytes signed data type is [-2147483648 ; 2147483647] etc...
If you still don't want to understand, compile and run this easy C source code, testing it with, for example, -32768 -32769 +32768. you can also change the type of 'a' to test it more.

'#include <stdio.h>

int main()


short int a;

printf ("\nInsert a number: ");


printf ("\nYour number is: %hi \n\n", a);

return 0;


You're assuming two's complement. But the C standard also allows ones' complement and sign + magnitude, where one loses one value. The minimal ranges are given in Section of the standard, e.g. −32767 for SHRT_MIN. Please read this section.
Giving a C code makes no sense because you are testing just one implementation. Not all implementations behave in the same way.
Vincent Lefèvre (talk) 02:14, 11 November 2015 (UTC)

ArbCom elections are now open![edit]

You appear to be eligible to vote in the current Arbitration Committee election. The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to enact binding solutions for disputes between editors, primarily related to serious behavioural issues that the community has been unable to resolve. This includes the ability to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail. If you wish to participate, you are welcome to review the candidates' statements and submit your choices on the voting page. For the Election committee, MediaWiki message delivery (talk) 12:58, 23 November 2015 (UTC)