octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62212] Wrong unsigned integer overflow with c


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62212] Wrong unsigned integer overflow with clang
Date: Wed, 23 Mar 2022 12:58:03 -0400 (EDT)

Follow-up Comment #6, bug #62212 (project octave):

Looks like it *is* undefined behavior:
https://en.cppreference.com/w/cpp/language/implicit_conversion
> Floating–integral conversions
> A prvalue of floating-point type can be converted to a prvalue of any
integer type. The fractional part is truncated, that is, the fractional part
is discarded. If the value cannot fit into the destination type, the behavior
is undefined (even when the destination type is unsigned, modulo arithmetic
does not apply).


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62212>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]