From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2AozEikGhWNBsQAAbAwnHQ (envelope-from ) for ; Mon, 28 Nov 2022 20:04:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4PMFEikGhWP8dwAAauVa8A (envelope-from ) for ; Mon, 28 Nov 2022 20:04:09 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F0E75AF54 for ; Mon, 28 Nov 2022 20:04:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozjP9-0005ax-0K; Mon, 28 Nov 2022 14:02:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozjP1-0005ZN-GE for emacs-orgmode@gnu.org; Mon, 28 Nov 2022 14:02:51 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozjOz-00054r-W9 for emacs-orgmode@gnu.org; Mon, 28 Nov 2022 14:02:51 -0500 Received: by mail-wr1-x433.google.com with SMTP id q7so17590601wrr.8 for ; Mon, 28 Nov 2022 11:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-language:subject:to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=EMdnQrUqa7TJYp4c8Va5qZV0rk7anLzkUjMByyBHf9A=; b=KHInt98lb9qfY1xF1kJtWsavfrvqQGDz6kXTtkfreIHeyEaOcFMrEaPtxda+jtvbEd nlV+b5GBvEMbH7JrlqzraOIfo5unjHjrf0CBP2NF4yM4y6kPkcvre3IhiNoA/a2kmeMn Yv1DYqo87p2tttU6tl/eTATLBkyuyQpa0/6buRkK/D6SPwzYOeH1gN2tvkH4sjbmR9B8 qj9doPhMXvST0YtSakhWhHB/sUE9A46nhUdqdsRBxDiO6FzL52BsV8McfKfnbL7DsgK9 qv81EeQAWrEbWwYpiwNTFrCoPEgZ1F4iL2nBIjGVcZkP+mhY0oqnNuqOWJx8buQ+rhR5 CQnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=from:content-language:subject:to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EMdnQrUqa7TJYp4c8Va5qZV0rk7anLzkUjMByyBHf9A=; b=CjWXaNnx5JlrS0+IU95RB0ck5OwMLkzpYco17qrxulnx6cNIBA3cX+q0kiRBmKrL8x w1TwVseqBI6AVblBkBFCboUBcVt3MWNEzEZjeWcj5IgkCZbuKaXFZaLsWEMgsNN3i293 Exal9xs+RNPdw45hI2bmR4+xHGfWQD8A+2H8j3ryd3Z3pL1SWUTqW/L/iugx/3wNYa3M fg9FdfI6G30wb/r8diCWNOoUXQbVFmIcQ6AY7o7lLrCvELFDAPuui6TTDWnrY1PWkjBw c+zvYTfw+Hqsqe+Z8mW15et3JBkv7r+wkTHgYU/wPFuuCjNTTRm0TFI9Rm+ADFlW2rcC l3Dw== X-Gm-Message-State: ANoB5pn8b3jer+rMngWFIecOoveeEI+4PWGD+rgAI+qTXo84IRAOD4y1 rSS+HPilNDt9qTPI7uSWSDUZeNwiHn4= X-Google-Smtp-Source: AA0mqf61aW3zXtoxbdKoftstFoO21jItiDtu//cemnAfwVAxJb8hEYggL88PuHkVpmufq1EGAQTqvQ== X-Received: by 2002:adf:b606:0:b0:22e:2efe:3176 with SMTP id f6-20020adfb606000000b0022e2efe3176mr31869093wre.241.1669662167825; Mon, 28 Nov 2022 11:02:47 -0800 (PST) Received: from [192.168.0.97] (static-80-103-60-95.ipcom.comunitel.net. [95.60.103.80]) by smtp.gmail.com with ESMTPSA id i18-20020adfb652000000b0022e36c1113fsm4957891wre.13.2022.11.28.11.02.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Nov 2022 11:02:47 -0800 (PST) Content-Type: multipart/alternative; boundary="------------ElxfTTMSv3CVREzJW6h21dUH" Message-ID: <428b9051-f934-6955-71e0-fbb21923be7d@gmail.com> Date: Mon, 28 Nov 2022 19:58:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Org-mode Subject: To convert and simplify units in tables (was:LIterate programming with calc (help)) Content-Language: en-GB From: Ypo Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669662249; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=EMdnQrUqa7TJYp4c8Va5qZV0rk7anLzkUjMByyBHf9A=; b=pmWOjiiNUyIo/fPH3MBoYn1bDsVI1CjUN05ZYspAnzm8FZFN3Tm3vJnApCpJdbTsVhuydr I5t2B3pf++AfQrzs+x7zIm4dfNOQfJv2zuVLvRhP1HyfijX55TPwBGauL01TMdP/gTquhJ O3H82QcfvYFhP+IsVpEae2WIZ4yEvp2/swN9IPS0tk85M9npsrQ04vDTkPYowYUR8BVztr ngeIm3J0yDGbIPJrQ52N1fAm9VBRATaKUOUL1bVZvlxVLQfiWOg0E4mNP7YitVXJvI5loJ 0Ar+Qcsrubd6F0/AdVX5pqmIhCi3haGXubtncI3Nz8YL5r0TjHWLzp+hNsFFng== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669662249; a=rsa-sha256; cv=none; b=BQp2vTsgs+G/kHCe8mXh1RFF/n3qsGly1wdY2pMN3U7H3OMK0OsmowiQKxLWkuyy8PSyfk HYtR1wo2O8zuho36Syu4xmBJ4o/kaO+EiZ9EJYvGV+5lQWNFQG1bXM/pc09sgID1aSHJLm EXregwOJgnPjBNWK+uzEBqzMd0dI3zorQO1PpzxKVhSuuF2vWqwklByVVEh3ybl0uLgu4R l5ur7P/nVZK3ac4ZlFKr/rf69QjvlVPuBcRB/wguOTCVXCECIh2Rh21FwsqscrBs/bp6Hq 1dz3QWrEpWxB+B+95WD+ytLLQwRo/Up8D9o3Lw66PGxKaK3aYYulftkyvxj+ww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KHInt98l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.76 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=KHInt98l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: F0E75AF54 X-Spam-Score: -8.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: juuGwEeaCPVQ This is a multi-part message in MIME format. --------------ElxfTTMSv3CVREzJW6h21dUH Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > #+TBLFM: $s=uconvert($W*$l/$Z,kg / cm^2)::$cs=uconvert($s_lim/$s, ) > > where uconvert is defined as: > > (defmath uconvert (v u) >   "Convert value V to compatible unit U." >   (math-convert-units v u)) > > > But no luck, "cs" result is an ERROR. Is it feasible to get a value > for "cs" with no units? > Ok, it is enough to add any unit to uconvert, for example: $cs=uconvert($s_lim/$s,m). That simplifies units in adimensional parameters. Best regards ;D --------------ElxfTTMSv3CVREzJW6h21dUH Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

#+TBLFM: $s=uconvert($W*$l/$Z,kg / cm^2)::$cs=uconvert($s_lim/$s, )

where uconvert is defined as:

(defmath uconvert (v u)
  "Convert value V to compatible unit U."
  (math-convert-units v u))


But no luck, "cs" result is an ERROR. Is it feasible to get a value for "cs" with no units?

Ok, it is enough to add any unit to uconvert, for example: $cs=uconvert($s_lim/$s,m). That simplifies units in adimensional parameters.

Best regards ;D

--------------ElxfTTMSv3CVREzJW6h21dUH--