Advanced range function

Advanced range function - A function that improves the normal range(). - Messaggi

#1 Pubblicato: 16/05/2020 12:47:52
Artem

Artem

2 apprezzamenti in 2 post.

Gruppo: User

A function that improves the normal range().

This is almost a normal range(), but it can plot a span from non-integers with a configurable step. Moreover, any numbers can be substituted inside the interval.

There are examples inside.




Get Range 3.sm (718,54 KiB) scaricato 1480 volta(e).

You can put the file in the snippet folder to quickly add it to any project.

I don't know much English, so I write through a translator. Russian forum is closed so I write here.
2 utenti hanno apprezzato questo post
Alvaro 16/05/2020 12:52:00, frapuano 16/05/2020 17:01:00
#2 Pubblicato: 16/05/2020 14:34:46
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Interesting, but can't see any use in real project.

idx.sm (6,12 KiB) scaricato 1403 volta(e).
#3 Pubblicato: 16/05/2020 15:46:20
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: Moderator

As I understand, the main objective is to have ranges with custom extra values.
Yet, given the size of the procedure, it must be much smarter than this:

re.png
re.sm (3,55 KiB) scaricato 1398 volta(e).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 utenti hanno apprezzato questo post
SteelCat 16/05/2020 17:11:00
#4 Pubblicato: 16/05/2020 16:02:43
Artem

Artem

2 apprezzamenti in 2 post.

Gruppo: User

Wrote

As I understand, the main objective is to have ranges with custom extra values.
Yet, given the size of the procedure, it must be much smarter than this:

re.png
re.sm (3,55 KiB) scaricato 1398 volta(e).




Wow, this is cool and so easy. I didn't realize it before.

And I understood why this option did not suit me. I needed to build a range that could start with a non-integer and end with a non-integer, but the main step should be an integer. That is, so that you can start with 0.99, and then the step becomes an integer. At the same time, it was necessary to change the step.

And inside non-integers as a bonus, just because the sorting function can do it.

There is probably a simpler solution, but I haven't found it.



I just needed a similar feature at the University and decided to share it here. Maybe it will be useful to someone.
#5 Pubblicato: 16/05/2020 16:17:45
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: Moderator

Wrote

I needed to build a range that could start with a non-integer and end with a non-integer, but the main step should be an integer. That is, so that you can start with 0.99, and then the step becomes an integer. At the same time, it was necessary to change the step.

And inside non-integers as a bonus, just because the sorting function can do it.

There is probably a simpler solution, but I haven't found it.



I just needed a similar feature at the University and decided to share it here. Maybe it will be useful to someone.



This might be a first approach...

re1.png
re1.sm (3,28 KiB) scaricato 1448 volta(e).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 utenti hanno apprezzato questo post
frapuano 16/05/2020 17:03:00
  • Nuovi post
  • Nessun nuovo post