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

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

[Octave-bug-tracker] [bug #66770] float not converted to int in input to


From: Rik
Subject: [Octave-bug-tracker] [bug #66770] float not converted to int in input to zeros()
Date: Mon, 10 Feb 2025 11:24:16 -0500 (EST)

Update of bug #66770 (group octave):

                Category:                    None => Octave Function
                  Status:                    None => Confirmed
                 Summary: Wrong convertion of float to int in function inputs
=> float not converted to int in input to zeros()

    _______________________________________________________

Follow-up Comment #1:

I can confirm the first example.  In fact, here is an even simpler example:


zeros (1, 9.999)
error: conversion of 9.999 to int64_t value failed


The example with linspace is correct.  Try 'help linspace' and see the final
Programming Note.


Programming Notes: For compatibility with MATLAB, return the second
     argument (END) when a single value (N = 1) is requested.  If N is
     not an integer then 'floor (N)' is used to round the number of
     elements.  If N is zero or negative then an empty 1x0 matrix is
     returned.


Standalone calculation of number of elements is


floor (0.6*1/0.05)
ans = 11




    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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