Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
index 05f6f5d62..afa19d8aa 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java
@@ -304,6 +304,23 @@ public class TCFNumberFormat {
return s;
}
+ public static String toComplexFPString(byte[] data, boolean big_endian) {
+ return toComplexFPString(data, 0, data.length, big_endian);
+ }
+
+ public static String toComplexFPString(byte[] data, int offs, int size, boolean big_endian) {
+ int fp_size = size / 2;
+ StringBuffer bf = new StringBuffer();
+ bf.append(toFPString(data, offs, fp_size, big_endian));
+ String i = toFPString(data, offs + fp_size, fp_size, big_endian);
+ if (!i.equals("0")) {
+ if (!i.startsWith("-")) bf.append('+');
+ bf.append(i);
+ bf.append('i');
+ }
+ return bf.toString();
+ }
+
public static BigInteger toBigInteger(byte[] data, boolean big_endian, boolean sign_extension) {
return toBigInteger(data, 0, data.length, big_endian, sign_extension);
}

Back to the top