Weird Result from Range

Weird Result from Range - Mensajes

#1 Publicado: 17/7/2023 1:20:34
netsonicyxf

netsonicyxf

2 me gusta en 79 mensajes.

Grupo: User

For n=5, the result is right.

But for n=6, it's supposed to have 7 elements instead of 6

Archivo no encontrado.Archivo no encontrado.
#2 Publicado: 17/7/2023 6:59:01
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrong way to discretize a range.
#3 Publicado: 17/7/2023 8:09:12
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: Moderator

Wrote

For n=5, the result is right.

But for n=6, it's supposed to have 7 elements instead of 6



Probably something about precision of double type. In the second range if you add a 10^-14 to the uppper bound it return the expected vector.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
A 2 usuarios les gustó este mensaje
netsonicyxf 17/7/2023 9:41:00, Oscar Campo 18/7/2023 15:18:00
#4 Publicado: 17/7/2023 10:40:35
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

n even starts being exact ... n 10
n odd stops being exact ..... n 15
You have no control on numerical arithmetic.
  • Nuevos mensajes
  • Sin mensajes nuevos