public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: tthomas@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Use BigInteger.compareTo for comparisons in logical operations. Date: Mon, 12 Nov 2007 18:14:00 -0000 [thread overview] Message-ID: <20071112181410.29988.qmail@sourceware.org> (raw) The branch, master has been updated via 0af7f15678cc58ed51713bb1c76fb384aa58be6c (commit) from a67dec4fdb23794fced6454ca317a4eb109e36a6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0af7f15678cc58ed51713bb1c76fb384aa58be6c Author: Teresa Thomas <tthomas@redhat.com> Date: Mon Nov 12 13:12:27 2007 -0500 Use BigInteger.compareTo for comparisons in logical operations. frysk-core/frysk/value/ChangeLog 2007-11-12 Teresa Thomas <tthomas@redhat.com> * IntegerUnit.java: Use BigInteger for logical operations. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/value/ChangeLog | 5 ++++- frysk-core/frysk/value/IntegerUnit.java | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/value/ChangeLog b/frysk-core/frysk/value/ChangeLog index 226c16f..39d3690 100644 --- a/frysk-core/frysk/value/ChangeLog +++ b/frysk-core/frysk/value/ChangeLog @@ -1,7 +1,10 @@ 2007-11-12 Teresa Thomas <tthomas@redhat.com> + * IntegerUnit.java: Use BigInteger for logical + operations. + * IntegerUnit.java: Use asLong() instead of - asBigInteger().longValue(). + asBigInteger().longValue(). 2007-11-11 Stan Cox <scox@redhat.com> diff --git a/frysk-core/frysk/value/IntegerUnit.java b/frysk-core/frysk/value/IntegerUnit.java index 663f193..3c6d9e4 100644 --- a/frysk-core/frysk/value/IntegerUnit.java +++ b/frysk-core/frysk/value/IntegerUnit.java @@ -39,6 +39,7 @@ package frysk.value; +import java.math.BigInteger; /** * Arithmetic and logical Operation handling * for integers. @@ -126,19 +127,19 @@ public class IntegerUnit public Value logicalAnd(Value v1, Value v2) { return retType.createValue - ((v1.asLong() == 0 ? false : true) - && (v2.asLong() == 0 ? false : true) ? 1 : 0); + ((v1.asBigInteger().compareTo(BigInteger.ZERO) == 0 ? false : true) + && (v2.asBigInteger().compareTo(BigInteger.ZERO) == 0 ? false : true) ? 1 : 0); } public Value logicalOr(Value v1, Value v2) { return retType.createValue - ((v1.asLong() == 0 ? false : true) - || (v2.asLong() == 0 ? false : true) ? 1 : 0); + ((v1.asBigInteger().compareTo(BigInteger.ZERO) == 0 ? false : true) + || (v1.asBigInteger().compareTo(BigInteger.ZERO) == 0 ? false : true) ? 1 : 0); } public Value logicalNegation(Value v1) { return retType.createValue - (v1.asLong() == 0 ? 1 : 0); + (v1.asBigInteger().compareTo(BigInteger.ZERO) == 0 ? 1 : 0); } public boolean getLogicalValue (Value v1) { - return ((v1.asLong() == 0) ? false : true); + return ((v1.asBigInteger().compareTo(BigInteger.ZERO) == 0) ? false : true); } } \ No newline at end of file hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-11-12 18:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071112181410.29988.qmail@sourceware.org \ --to=tthomas@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).