Advanced range function

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

#1 Posted: 5/16/2020 12:47:52 PM
Artem

Artem

2 likes in 2 posts.

Group: 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 KiB) downloaded 71 time(s).

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 users liked this post
Alvaro Diaz Falconi 5/16/2020 12:52:00 PM, frapuano 5/16/2020 5:01:00 PM
#2 Posted: 5/16/2020 2:34:46 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

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

idx.sm (6 KiB) downloaded 56 time(s).
#3 Posted: 5/16/2020 3:46:20 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: 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 KiB) downloaded 51 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
SteelCat 5/16/2020 5:11:00 PM
#4 Posted: 5/16/2020 4:02:43 PM
Artem

Artem

2 likes in 2 posts.

Group: 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 KiB) downloaded 51 time(s).




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 Posted: 5/16/2020 4:17:45 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: 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 KiB) downloaded 57 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
frapuano 5/16/2020 5:03:00 PM
  • New Posts New Posts
  • No New Posts No New Posts