<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Error in simple division</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/</id><updated>2024-04-25T16:18:45.685000Z</updated><subtitle>Recent posts to Error in simple division</subtitle><entry><title>Error in simple division</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/?limit=25#9146" rel="alternate"/><published>2024-04-25T16:18:45.685000Z</published><updated>2024-04-25T16:18:45.685000Z</updated><author><name>benitohb</name><uri>https://forge.codesys.com/u/benitohb/</uri></author><id>https://forge.codesys.com5e8089aca4b759e67960737778b5aece8ab15e60</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello.&lt;br/&gt;
how can I do this but whit variables? I'm triying but i dont why, the result missed the decimals.&lt;/p&gt;
&lt;p&gt;this is my program:&lt;/p&gt;
&lt;p&gt;var&lt;br/&gt;
var1: REAL;&lt;br/&gt;
var2: REAL;&lt;br/&gt;
var3: REAL:&lt;br/&gt;
end_var&lt;/p&gt;
&lt;p&gt;var1:=100;&lt;br/&gt;
var2:=40;&lt;br/&gt;
var3:= var1 / var2;&lt;/p&gt;
&lt;p&gt;I would expect the value of var3 will be 2.5, but I have only 2&lt;/p&gt;
&lt;p&gt;can you help me please.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error in simple division</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/?limit=25#6d40" rel="alternate"/><published>2020-02-27T14:35:06.598000Z</published><updated>2020-02-27T14:35:06.598000Z</updated><author><name>jonathanD</name><uri>https://forge.codesys.com/u/jonathand/</uri></author><id>https://forge.codesys.comd6c0b095f2f12bab9cbc1e9dc53121abcc458477</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks you!&lt;br/&gt;
That worked.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error in simple division</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/?limit=25#ede9" rel="alternate"/><published>2020-02-27T14:35:06.123000Z</published><updated>2020-02-27T14:35:06.123000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com3e29b54a2df281dc5aa6f70f0d81e795449a8627</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;A:=600.0/(123.0-2300.0)&lt;/p&gt;
&lt;p&gt;Use .0 after all numbers&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error in simple division</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee2cc88f72/?limit=25#f528" rel="alternate"/><published>2020-02-27T14:35:04.760000Z</published><updated>2020-02-27T14:35:04.760000Z</updated><author><name>jonathanD</name><uri>https://forge.codesys.com/u/jonathand/</uri></author><id>https://forge.codesys.comd757ea9131f509a565563421bf5c4b326e60b077</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a simple division line, but the problem is that the variable does store the value of that division.&lt;br/&gt;
I tried with a simple example: a := 100 / (600 -3437);&lt;br/&gt;
But 'a' does not store the value, and shows 0.&lt;br/&gt;
'a' is defined as REAL, also tried LREAL.&lt;/p&gt;
&lt;p&gt;Any suggestions about what the problem is?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Jonathan&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>