This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Informe aqui as receitas brutas mensais (faturamentos) | |
receitas_brutas_mensais = [ | |
9_999.99, | |
] | |
cliente_reside_no_exterior = true | |
prolabore_atual = nil | |
# Salve e rode no terminal: ruby meus_impostos_pj.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Exercise 1.7. | |
;; The good-enough? test used in computing square roots will not be very effective for | |
;; finding the square roots of very small numbers. Also, in real computers, arithmetic operations are almost | |
;; always performed with limited precision. This makes our test inadequate for very large numbers. Explain | |
;; these statements, with examples showing how the test fails for small and large numbers. An alternative | |
;; strategy for implementing good-enough? is to watch how guess changes from one iteration to the | |
;; next and to stop when the change is a very small fraction of the guess. Design a square-root procedure | |
;; that uses this kind of end test. Does this work better for small and large numbers? | |
; The problem with the good-enough? procedure for small numbers is that there radicant is much smaller than |