summaryrefslogtreecommitdiff
path: root/Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R
diff options
context:
space:
mode:
Diffstat (limited to 'Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R')
-rw-r--r--Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R12
1 files changed, 12 insertions, 0 deletions
diff --git a/Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R b/Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R
new file mode 100644
index 00000000..605a63de
--- /dev/null
+++ b/Numerical_Methods_by_E_Balaguruswamy/CH3/EX3.9/Ex3_9.R
@@ -0,0 +1,12 @@
+# Example 9 Chapter 3 Page no.: 51
+# COnversion of integer to 16 bit Binary
+
+
+x <- -32768
+
+install.packages("binaryLogic")
+library("binaryLogic")
+
+y <- as.binary(x, size=2, n=0, logic=FALSE)
+
+cat("The integer",x,"can be represented as",print(y),"in 16 Bit binary format")