real-number

Large float and double numbers in java printing/persisting incorrectly. Is this behavior due to number of significant digits?

戏子无情 提交于 2019-12-25 00:37:18
问题 In an application I am working some numbers get converted and saved from long(18 digits) to float/double. These numbers are like Reference/Id's but not used for calculations. Recently I noticed some discrepancies in data being stored as float/double. I am trying to understand if the behavior is due to what floating point numbers call significant digits and maybe a simple explanation for the same. My questions based on below program are Output no : 5 shows a really big number(39 digits before

How to automatically prove simple equality of real numbers in Coq?

匆匆过客 提交于 2019-12-19 10:32:50
问题 What I am looking for is an auto -like tactic that can prove simple equalities like: 1/2 = 2/4 So far, what I've tried manually is to use ring_simplify and field_simplify to prove equalities. Even this doesn't work out well (Coq 8.5b3). The example below works: Require Export Coq.Reals.RIneq. Local Open Scope Z_scope. Local Open Scope R_scope. Example test2: 1 = 1 / 1. Proof. field_simplify. field_simplify. reflexivity. Qed. But it was necessary to use field_simplfy twice before reflexivity .

How to input and output real numbers in assembly language

烈酒焚心 提交于 2019-12-11 15:39:18
问题 We solve problems with real numbers in assembly language using FPU. Usually we write input and output code using C language or ready functions.For example: ; Receiving input and output descriptors for the console invoke GetStdHandle, STD_INPUT_HANDLE mov hConsoleInput, eax invoke GetStdHandle, STD_OUTPUT_HANDLE mov hConsoleOutput, eax invoke ClearScreen ;input X invoke WriteConsole, hConsoleOutput, ADDR aszPromptX,\ LENGTHOF aszPromptX - 1, ADDR BufLen, NULL invoke ReadConsole, hConsoleInput,

Stronger completeness axiom for real numbers in Coq

我们两清 提交于 2019-12-10 18:49:46
问题 Here is the completeness axiom defined in the Coq standard library. Definition is_upper_bound (E:R -> Prop) (m:R) := forall x:R, E x -> x <= m. Definition bound (E:R -> Prop) := exists m : R, is_upper_bound E m. Definition is_lub (E:R -> Prop) (m:R) := is_upper_bound E m /\ (forall b:R, is_upper_bound E b -> m <= b). Axiom completeness : forall E:R -> Prop, bound E -> (exists x : R, E x) -> { m:R | is_lub E m }. Suppose I add in Axiom supremum :forall E:R -> Prop, (exists l : R,is_upper_bound

How to automatically prove simple equality of real numbers in Coq?

女生的网名这么多〃 提交于 2019-12-01 10:45:21
What I am looking for is an auto -like tactic that can prove simple equalities like: 1/2 = 2/4 So far, what I've tried manually is to use ring_simplify and field_simplify to prove equalities. Even this doesn't work out well (Coq 8.5b3). The example below works: Require Export Coq.Reals.RIneq. Local Open Scope Z_scope. Local Open Scope R_scope. Example test2: 1 = 1 / 1. Proof. field_simplify. field_simplify. reflexivity. Qed. But it was necessary to use field_simplfy twice before reflexivity . The first field_simplfiy gives me: 1 subgoal ______________________________________(1/1) 1 / 1 = 1 / 1