<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/3723" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-02-22T07:12:08-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/3723</id>

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-02-22T07:12:08-04:00</updated>

		<published>2003-02-22T07:12:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16920#p16920</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16920#p16920"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16920#p16920"><![CDATA[
You must have put parenthesis around the integer part. Expr follows order of operations. All you have to do is:<br><br>puthelp "PRIVMSG $chan :[expr 1.0 * $arg]"<br><br>You could also do a regsub which adds a .0 to all integers in the expression.<br><br>But if you are using $arg as input from a user, be careful, because expr will evaluate commands in brackets.<br><br>e.g.<br>% set arg {3 + [hello]}<br>3 + [hello]<br>% expr $arg<br>invalid command name "hello"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 22, 2003 7:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2003-02-22T06:47:10-04:00</updated>

		<published>2003-02-22T06:47:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16917#p16917</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16917#p16917"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16917#p16917"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>puthelp "PRIVMSG $chan :[expr (1.0 * ($arg))]"</code></pre></div>"= 3/2":<br>it just puts "1.0"...<br><br>but doesnt really matter. was just a test.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Sat Feb 22, 2003 6:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-02-21T15:17:20-04:00</updated>

		<published>2003-02-21T15:17:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16887#p16887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16887#p16887"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16887#p16887"><![CDATA[
Just put "1.0 *' at the beginning of the expr and it'll always be double.<br><br>% expr "1.0 * 3/2"<br>1.5<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Feb 21, 2003 3:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-21T12:38:16-04:00</updated>

		<published>2003-02-21T12:38:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16886#p16886</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16886#p16886"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16886#p16886"><![CDATA[
It should type:"3 / 2" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 21, 2003 12:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-02-21T11:42:33-04:00</updated>

		<published>2003-02-21T11:42:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16883#p16883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16883#p16883"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16883#p16883"><![CDATA[
yes you do<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Feb 21, 2003 11:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2003-02-21T11:38:21-04:00</updated>

		<published>2003-02-21T11:38:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16882#p16882</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16882#p16882"/>
		<title type="html"><![CDATA[expr ALWAYS with double?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16882#p16882"><![CDATA[
hi<br>ive got this simple script<div class="codebox"><p>Code: </p><pre><code>bind pub - "=" calc_calcproc calc_calc {nick userhost hand chan arg} {puthelp "PRIVMSG $chan :[expr $arg]"}</code></pre></div>but if a user types "= 3/2", the result is "1" because expr calculates integers. how can i tell expr to ALWAYS use doubles? result should be "1.5". ill have to change $arg, havent i?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Fri Feb 21, 2003 11:38 am</p><hr />
]]></content>
	</entry>
	</feed>
