From b2280288e40b3845e5a473503e39448441c74c28 Mon Sep 17 00:00:00 2001 From: KubMakCZ Date: Thu, 15 Oct 2026 12:20:29 +0200 Subject: [PATCH] fix --- vue/03_pocitadlo/src/App.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/vue/03_pocitadlo/src/App.vue b/vue/03_pocitadlo/src/App.vue index a4d3c53..d085e2c 100644 --- a/vue/03_pocitadlo/src/App.vue +++ b/vue/03_pocitadlo/src/App.vue @@ -33,6 +33,8 @@ @@ -62,7 +64,22 @@ export default { return "nelze dělit nulou!"; } return this.a % this.b - }, + }, + procenta(){ + if (this.b === 0) { + return "nelze počítat s nulou" + } + return ((this.a/this.b)*100).toFixed(1) + "%" + }, + odmocnina(){ + if (this.b === 0) { + return "Nultá odmocnina neexistuje!" + } + if (this.a <0){ + return "Pro záporné A nelze v realných číslech obecně počítat" + } + return Math.pow(this.a,1/this.b).toFixed(6) + }, porovnej() { if(this.a > this.b) return "A je větší než B" if(this.a < this.b) return "A je menší než B"