List uses float indexing error

小數連續4個連加,之後乘以10成為整數後,發生索引錯誤。
After adding 4 consecutive decimals and then multiplying by 10 to become an integer, an index error occurs.




Float_Add_2023_0801.aia (7.2 KB)

I do not get any errors when running your blocks.

You may want to replace the textbox with a label inside a vertical scrolling arrangement, it is much more responsive to scrolling.

Is this whole exercise to show how 0.1 is an infinitely repeating binary number, unable to provide exact values?

Sorry! My English is bad. Thanks! your reply.
我想表達的意思是浮點運算*10後,進位為整數,部分會產生誤差。
What I want to express is that after the floating-point operation *10, the carry is an integer, and some errors will occur.

Provide an example with a mathematical equation....

and show your relevant blocks

Thanks!
This block program only expresses that when the floating-point operation is carried into an integer, the result is unreasonable. An error occurs when used for indexing.
(這個區塊程式只是表達浮點運算進位為整數時,其結果不合理。在使用於索引時會發生錯誤。)

Again, please provide an example

Float_Add_2023_0815.aia (3.3 KB)


This fixes it

Thanks!
I have actually solved it, the post is just an expression, the result is unreasonable, the compiler should be modified.
(我其實已經解決,發文只是表達,其結果不合理,應修改編譯器。)
I use this.

If this is important to you, consider learning Cobol.
It was designed for decimal data, and there are probably job openings to replace dead Cobol coders.

1 Like

Probably worth noting that a list index expects an integer, 8.0 is NOT an integer.